package demo.spring.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: tyzhang
 * @Description:
 * @Date: Created in 22:32 2018/1/30
 */
@Aspect
@Component
public class MyBook {
    @Before("execution( * demo.spring.aop.Book.add())")
    public void before(JoinPoint joinPoint){
        String methodName=joinPoint.getSignature().getName();
        List<Object> list= Arrays.asList(joinPoint.getArgs());
        System.out.println("前置增强........"+methodName+"参数"+list);
    }
}
